package com.square.service.common.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.square.service.common.handler.ApiCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用控制层
 *
 * @author : 王苏
 * @since : 2021/4/20 14:20
 */
@RestController
public class CommonController {

    /**
     * 配置404页面
     */
    @RequestMapping("*")
    public R<?> notFound() {
        return R.failed(ApiCode.NOT_FOUND);
    }


    /**
     * shiro过滤器接口拦截
     *
     * @return
     */
    @GetMapping("/authFail")
    public R<?> authFail() {
        return R.failed(ApiCode.INVALID_PERMISSION);
    }
}
